<?php
class Check{
	
	public $data=[
		[
			'title'=>"不知密码",
			'href'=>"tel:18272330980",
			'txt'=>"拨打：18272330980",
			'target'=>'_self',
		],
		
	];
	
	function p(){
		$data=$this->data;
		echo '<div class="row">';
		foreach($data as $xm){
			if($xm['txt']){
				echo '<div class="col-xs-6 col-lg-3 col-md-4 col-sm-6"> ';
				echo '<h4>'.$xm['title'].'</h4>';
				echo '<br/><a target="'.$xm['target'].'" class="btn btn-info btn-lg btn-block" href="'.$xm['href'].'">'.$xm['txt'].'</a><br/>';		
				echo '</div>';
			}
		}
		echo '</div>';
	}
	
	function __construct(){
		if(isset($_SESSION['admin'])&& $_SESSION['admin']==PWD){
			return;
		}
		
		if(isset($_REQUEST['guanlilogin'])&& $_REQUEST['mima']==PWD)
		{
			$_SESSION['admin']=$_REQUEST['mima'];
		}else{
			?>
			<meta charset="utf-8">			
			<link rel="stylesheet" href="css/bootstrap.css">
			<script src="js/bootstrap.js"></script>
			<div class="container">
				<br />
				<div class="jumbotron">
					<h2><?php echo SHANGHU; ?></h2>
					<br />
					<p>
						 <div class="panel panel-default">
						    <div class="panel-body">
						        <form action="<?php echo $_SERVER['PHP_SELF']?>" method='post' role="form">
									<div class="form-group">
										<label for="password" class=" control-label">请输入密码</label>
					                	<input type='password' name='mima' class ="form-control" id="password" />				
									</div>								
					                <input type='submit' name='guanlilogin' class ="" value="登陆" />
								</form>
						    </div>
						</div>
						
					</p>
					  
				</div>
				
				<?php 
					$this->p();
				?>
				
				
			</div>
			<?php
			exit();
		}
	}
}
?>